<h1 class="font-azul" style="margin-left:25px;">Últimas Notícias</h1>
<?php //( in_category('Artigos') ) == 0)
do_vertical_space('15');
global $aux; 
$aux = 1;
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('category_name=noticias&posts_per_page=20'.'&paged='.$paged);
$postCount = 0;

while ($wp_query->have_posts()) : $wp_query->the_post();
	$postCount = $postCount + 1;
	
    if ($aux == 1) { ?>
		<div class="conteiner-noticia"> <?php 
			if ( has_post_thumbnail() ) { ?>
				<div style="width: 308px; float: left;">
					<div style="width: 308px; float: left; margin-top: 10px;">
						<div style="float: left;"><?php the_post_thumbnail('thumbs-noticias'); ?></div>
						<h2><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>" target="_blank"><?php the_title();?></a></h2>
						<?php do_vertical_space('5'); ?>
						<p class="data"><?php the_time(get_option('date_format')); ?></p>
						<?php do_vertical_space('3'); ?>
					</div>
					<?php do_vertical_space('5'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>"  target="_blank"><?php the_excerpt_max_charlength(380); ?></a>
					</div>
					<?php do_vertical_space('5'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'avpt_noticias_fonte', true); ?></p></div>
				</div>
	    		<?php 
	    	} else { ?>
	    			<div style="width: 308px; float: left;">
						<div style="width: 308px; float: left; margin-top: 10px;">
							<h2 style="margin: 0;"><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>" target="_blank"><?php the_title();?></a></h2>
							<?php do_vertical_space('5'); ?>
							<p class="data" style="margin: 0;"><?php the_time(get_option('date_format')); ?></p>
						    <?php do_vertical_space('3'); ?>
						</div>
						<?php do_vertical_space('5'); ?>
						<div class="resumo">
							<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>"  target="_blank"><?php the_excerpt_max_charlength(380); ?></a>
						</div>
						<?php do_vertical_space('5'); ?>
						<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'avpt_noticias_fonte', true); ?></p></div>
					</div>
			<?php    			
	    	}
	    	$aux = $aux+1; 	
    } elseif ($aux == 2) { 
			if ( has_post_thumbnail() ) { ?>
				<div style="width: 308px; float: right;">
					<div style="width: 308px; float: right; margin-top: 10px;">
						<div style="float: left;"><?php the_post_thumbnail('thumbs-noticias'); ?></div>
						<h2><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>" target="_blank"><?php the_excerpt_max_charlength(380);?></a></h2>
						<?php do_vertical_space('5'); ?>
						<p class="data"><?php the_time(get_option('date_format')); ?></p>
					    <?php do_vertical_space('3'); ?>
					</div>
					<?php do_vertical_space('5'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>" target="_blank"><?php the_excerpt_max_charlength(380); ?></a>
					</div>
					<?php do_vertical_space('5'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'avpt_noticias_fonte', true); ?></p></div>
				</div>
    		<?php 
    		} else { ?>
				<div style="width: 308px; float: right;">
					<div style="width: 308px; float: right; margin-top: 10px;">
						<h2 style="margin: 0;"><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>" target="_blank"><?php the_title();?></a></h2>
						<?php do_vertical_space('5'); ?>
						<p class="data" style="margin: 0;"><?php the_time(get_option('date_format')); ?></p>
						<?php do_vertical_space('3'); ?>
					</div>
					<?php do_vertical_space('5'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'avpt_noticias_url', true); ?>" target="_blank"><?php the_excerpt_max_charlength(380); ?></a>
					<?php do_vertical_space('5'); ?>
					</div>
					<?php do_vertical_space('5'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'avpt_noticias_fonte', true); ?></p></div> 
				</div>	
			<?php    			
    		}
    		?>
	</div> <!-- Feha div conteiner-noticia  -->
	<hr size="1" color= "#eaeaea" style="width: 308px; margin: auto auto auto 25px; float: left;" />
	<hr size="1" color= "#eaeaea" style="width: 308px; margin: 0 25px 0 0; float: right;" />
	<?php 
	$aux = 1;		
    }
endwhile; 
if ( $postCount%2 == 1 ) { ?>
   				<div style="width: 308px; float: right;"></div>
	</div><!-- Esta div fecha o bloco completo no loop -->		
<?php 
}	
?>	
<div class="clr"></div>
<?php do_vertical_space('10'); ?>
<?php 
//Faz a paginação do conteúdo
$url = get_bloginfo( 'url' );
$url = $url.'/noticias/';
?>
<div style="margin-left:25px;"><?php pagination( $wp_query, $url );?></div>


